<template>
   <div>
     <h1>子组件</h1>
     <div>{{car}} -- {{money}}
       <button @click="buy">花钱</button>
     </div>
   </div>
</template>
<script setup>
const emit = defineEmits(["changeMoney"])
const props = defineProps({
  car: String,
  money: Number
})
const buy=()=>{
  emit("changeMoney", 5)
}
</script>
<style scoped lang="less">

</style>
